<?php

class Admin extends Zend_Db_Table{
  protected $_name = 'admin';
  protected $_primary = 'uname';

  public function check($username, $password){
      $db = $this->getAdapter();
      $where = $db->quoteInto('uname = ?', $username);
      $res = $this->fetchRow($where);
      if($res!=null && $res['password'] == md5($password)){
          return $res;
      }
      return null;
  }
}
